import { http } from "@/utils/http";
import { baseUrlApi } from "./utils";

type Result = {
  code: number;
  data?: any;
};

type ResultTable = {
  code: number;
  data?: {
    /** 列表数据 */
    list: Array<any>;
    /** 每页显示条目个数 */
    pageSize?: number;
    /** 当前页数 */
    currentPage?: number;
  };
  /** 总条目数 */
  total?: number;
};

export const updatePassword = (id: number, data?: object) => {
  return http.request<ResultTable>(
    "put",
    baseUrlApi(`user/${id}/modify-password`),
    {
      data
    }
  );
};
